<template>
	<view>
		<slot></slot>

		<view v-for="(item, index) in chat.data" :key="index" v-if="user.isLogin">
			<rui-chat-message-right v-if="item.type == 'me'" :data="item"></rui-chat-message-right>
			<rui-chat-message-left v-if="item.type == 'search'" :data="item"></rui-chat-message-left>
			<rui-chat-message-tips v-if="item.type == 'tips'" :data="item"></rui-chat-message-tips>
			<rui-chat-message-system v-if="item.type == 'system'" :data="item"></rui-chat-message-system>
		</view>
		
	</view>

</template>

<script setup>
	import {
		userStore,
		chatStore
	} from "@/store/index.js"

	const chat = chatStore();
	const user = userStore();
	
</script>

<style>

</style>